package com.dq.Week2.day06.homeWork;

public class Demo {
    public static void main(String[] args) {
        printEndash(100,"-");
        //普通英雄
        Hero hero = new Hero("Kanavi",30,100,20);
        hero.generalCombat();//使用普通攻击
        System.out.println(hero);
        printEndash(100,"-");

        //战士
        Warrior warrior = new Warrior("Sirl",50,35,90,500);
        warrior.heroicStrike();
        System.out.println(warrior);
        printEndash(100,"-");

        //多态
        Hero h = new Warrior("XiaoAi",100,50,100,500);
        h.generalCombat();
        System.out.println(h);
        printEndash(100,"-");

    }
    public static void printEndash(int number,String symbol){
        for (int i = 0; i < number;i++) {
            System.out.print(symbol);
        }
        System.out.println("");
    }
}
